
<!DOCTYPE html>
<html class="no-js css-menubar" lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">

    <title>微米荟商城</title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />

    <!-- Stylesheets -->
    <link rel="stylesheet" href="https://static.9hive.cn/global/vendor/bootstrap-3.3.7/bootstrap.min.css">
    <link rel="stylesheet" href="https://static.9hive.cn/global/css/bootstrap-extend.min.css?v2.2.0">
    <link rel="stylesheet" href="https://static.9hive.cn/mmenu/assets/css/site.min.css?v2.2.0">

    <!-- Plugins -->
    <link rel="stylesheet" href="https://static.9hive.cn/global/vendor/animsition/animsition.min.css?v2.2.0">
    <!-- Page -->
    <link rel="stylesheet" href="https://static.9hive.cn/mmenu/assets/examples/css/pages/login-v2.min.css?v2.2.0">

    <!-- Fonts -->
    <link rel="stylesheet" href="https://static.9hive.cn/global/fonts/web-icons/web-icons.min.css?v2.2.0">
    <link rel="stylesheet" href="https://nsr.9hive.cn/hive/assets/admin/admin2.css">
    <link rel="stylesheet" href="https://static.9hive.cn/global/vendor/custom/custom.css">
    <!--[if lt IE 9]>
    <script src="https://static.9hive.cn/global/vendor/html5shiv/html5shiv.min.js"></script>
    <![endif]-->

    <!--[if lt IE 10]>
    <script src="https://static.9hive.cn/global/vendor/media-match/media.match.min.js"></script>
    <script src="https://static.9hive.cn/global/vendor/respond/respond.min.js?v=1.0"></script>
    <![endif]-->

    <!-- Scripts -->
    <!--   <script src="https://static.9hive.cn/hive/assets/admin/login.js"></script>
   -->
    <style type="text/css">
        .page-login-v2:before {
            background-image: url("https://static.9hive.cn/hive/assets/images/register.jpg");
        }

        .page-login-v2 form {
            width: 100%;
            height: 100%;
            padding: 20px 40px;
            margin: 0;
            /*   background-color: white;*/
        }
        .form-group{
            line-height: 34px;
        }
        .text_left{
            font-size: 32px;
        }
        .label-color{
            color: red;
        }
        .control-label{
            text-align: right;
        }


    </style>
</head>
<body class="page-login-v2 layout-full page-dark">
<!-- Page -->
<div class="page animsition" data-animsition-in="fade-in" data-animsition-out="fade-out">
    <div class="page-content2">
        <div class="page-brand-info">
            <div class="brand">
                <img class="brand-img" src="https://static.9hive.cn/hive/assets/images/joy.png" alt="...">
                <h2 class="brand-text font-size-20">微米荟商城</h2>
            </div>
            <div class="brand">
                <a class="brand-a">官网首页</a>
                <a href="/login">登录</a>
                <!--<a href="register.html">注册</a>-->
            </div>
            <!--            <p class="font-size-20">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                            tempor incididunt ut labore et dolore magna aliqua.</p>-->
        </div>

        <div class="hive-register-main">
            <div class="hive_form_content ">
                <div class="hive_form_content_left left_padding">
                    <div class="text_left">注册</div>
                    <div>

                        <pre class="pre_text font-size-16">
专注为一线品牌提供全渠道品效营销
让营销的每一分钱产生数据价值

                        </pre>
                    </div>

                    <div class="footer_div text_left font-size-16">
                        上海微米荟商城科技有限公司
                    </div>
                </div>


                <div class="hive_form_content_right">
                    <form class="form_pos" role="form" onsubmit="return register()" style="position: relative">
                        <div class="form_middle">
                            <div class="form-group row ">

                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>运营者手机号</label>
                                <div class="col-lg-5 col-md-6">
                                    <input class="form-control inline" placeholder="请输入手机号码" id="phone">
                                </div>
                                <div class="col-lg-1 col-md-2" style="margin-left: -26px;">
                                    <button id="sendCode" class="btn btn-primary btn-sm btn-lg" type="button" value="">验证码
                                    </button>
                                </div>

                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>短信验证码</label>
                                <div class="col-lg-6 col-md-8">
                                    <input class="form-control" placeholder="请输入短信验证码" id="captcha">

                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>登录名</label>
                                <div class="col-lg-6 col-md-8">
                                    <input class="form-control" placeholder="请输入登录名(数字、字母、下划线)" id="username">

                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>密码</label>
                                <div class="col-lg-6 col-md-8">
                                    <input class="form-control" placeholder="字母、数字或者英文符号，最短8位，区分大小写" type="password" id="password">

                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>确认密码</label>
                                <div class="col-lg-6 col-md-8">
                                    <input class="form-control" placeholder="请确认密码" type="password" id="rePassword">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>品牌名称</label>
                                <div class="col-lg-6 col-md-8">
                                    <input class="form-control" placeholder="请输入品牌名称" id="brandName">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "><label class="label-color">*</label>运营者姓名</label>
                                <div class="col-lg-6 col-md-8">
                                    <input class="form-control" placeholder="请输入运营者姓名" id="personInCharge">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 ">所属行业</label>
                                <div class="col-lg-6 col-md-8 ">
                                        <div class="row">
                                            <div class="col-sm-6">
                                                <select name="category_one" class="form-control" id="category_one" ></select>
                                            </div>
                                            <div class="col-sm-6">
                                                <select name="category_two" class="form-control" id="category_two" ></select>
                                            </div>

                                            <script src="/res/plugins/jiuyue/category_select.js"></script>
                                            <script type="text/javascript">
                                                new category('category_one', 'category_two', '', '');
                                            </script>
                                        </div>
                                </div>
                            </div>
                            <div class="form-group margin-top-50">
                                <div class="row">
                                    <label class="control-label col-lg-3 text-right  register_color col-lg-offset-1 "></label>
                                    <div class="col-lg-6 col-md-8 ">
                                        <button class="btn btn-primary with_100p" type="submit">注册</button>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </form>

                </div>
            </div>

        </div>
    </div>
    <div id="toastContent"
         class="toast_content flexed width-md-300 height-md-200 width-lg-350 height-lg-250">
        <div class="text-center text-middle flex_l padding-top-40">注册成功，你可以使用全部功能5天</div>
        <div class="flex_l text-middle text-center padding-top-15">
            <button class="btn btn-primary  " id="closeBtn">知道了</button>
        </div>
    </div>
    <footer>Copyright All Rights Reserved © 2017</footer>

</div>
<!-- End Page -->


<!-- Core  -->
<script src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
<script src="https://static.9hive.cn/global/vendor/bootstrap-3.3.7/bootstrap.min.js"></script>
<script src="https://static.9hive.cn/global/vendor/animsition/animsition.min.js"></script>
<!-- Scripts -->
<script src="https://static.9hive.cn/global/js/core.min.js"></script>
<script src="https://static.9hive.cn/mmenu/assets/js/site.min.js"></script>

<script src="https://static.9hive.cn/global/js/configs/config-colors.min.js"></script>
<script src="https://static.9hive.cn/global/js/components/animsition.min.js"></script>
<script src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>


<script>

    (function (document, window, $) {
        'use strict';

        var Site = window.Site;
        $(document).ready(function () {
            Site.run();
        });
    })(document, window, jQuery);
</script>

<script>
    function register() {
        var regPassword=/^[a-zA-Z0-9_]+$/;//数字字母下划线
        var regPhone = /^0?(13[0-9]|15[0-9]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/ ; //手机正则表达式
        var phone=$("#phone").val();//手机号
        var captcha=$("#captcha").val();//验证码
        var username=$("#username").val();//用户名
        var password=$("#password").val();//密码
        var rePassword=$("#rePassword").val();//重复密码
        var personInCharge=$("#personInCharge").val();//企业负责人
        var brandName=$("#brandName").val();//企业名称
        var category_one=$("#category_one").val();//一级类目
        var category_two=$("#category_two").val();//二级类目
        if(!regPhone.test(phone)){
            layer.msg("请输入正确的手机号!");
            return false;
        }
        if(!captcha){
            layer.msg("短信验证码不允许为空!");
            return false;
        }
        if(!username){
            layer.msg("登录名不允许为空!");
            return false;
        }
        if(!regPassword.test(username)){
            layer.msg("登录名只能输入数字、字母或者下划线!");
            return false;
        }
        if(!password){
            layer.msg("密码不允许为空!");
            return false;
        }
        if(password.length<8){
            layer.msg("密码不能小于8个字符!");
            return false;
        }
        if(!regPassword.test(password)){
            layer.msg("密码只能输入数字、字母或者下划线!");
            return false;
        }
        if(password!=rePassword){
            layer.msg("两次密码输入不一致!");
            return false;
        }
        if(!brandName){
            layer.msg("品牌名称不允许为空!");
            return false;
        }
        if(!personInCharge){
            layer.msg("运营者姓名不允许为空!");
            return false;
        }
        $.ajax({
            url: "/login/registerIn",
            type: "POST",
            data: {
                phone: phone,
                captcha:captcha,
                username:username,
                password: password,
                personInCharge:personInCharge,
                brandName:brandName,
                categories:category_one+","+category_two
            },
            success: function (data) {
                if (data.state=="ok" == true) {
                    //注册成功
                    window.location="/login/afterRegister";

                } else {
                    layer.msg(data.info);
                    return false;
                }
            }
        });

        return false;
    }
    $("#closeBtn").click(function () {
        layer.closeAll();
        var username=$("#username").val();//用户名
        window.location.href = "/login/"+username;
    });
    $("#sendCode").on('click', function () {
        var regPhone = /^0?(13[0-9]|15[0-9]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/ ; //手机正则表达式
        var phone=$("#phone").val();
        if(!regPhone.test(phone)){
            layer.msg("请输入正确的手机号!");
            return false;
        }
        $.ajax({
            url: "/login/getCaptcha",
            type: 'GET',
            data:{
                "phone": phone
            },
            success: function(data){
                if (data.state=="ok" == true){
                    layer.msg("验证码发送成功");
                    setTime();
                }else{
                    layer.msg(data.info);
                }
            }});

    });

    var time = 60;
    function setTime() {
        time--;
        $("#sendCode").attr('disabled', 'disabled');
        $("#sendCode").html(time + " s ");
        if (time > 0) {
            setTimeout(setTime, 1000);
        } else {
            $("#sendCode").attr('disabled', false);
            $("#sendCode").html("验证码");
            time = 60;
        }
    };
    $(document).ready(function () {
        $("#toastContent").hide();
    });

</script>
<!-- Google Analytics -->
<script>
    (function (i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r;
        i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
        a = s.createElement(o),
            m = s.getElementsByTagName(o)[0];
        a.async = 1;
        a.src = g;
        m.parentNode.insertBefore(a, m)
    })(window, document, 'script', '',
        'ga');

    ga('create', 'UA-65522665-1', 'auto');
    ga('send', 'pageview');
</script>
</body>

</html>